﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace TeamWPF
{
    /// <summary>
    /// Interaction logic for RegisterMenu.xaml
    /// </summary>
    public partial class RegisterMenu : Window
    {
        public RegisterMenu()
        {
            InitializeComponent();
            RegisterVehicle.Checked += (send, ev) => { RegisterEmployee.IsChecked = false; };
            RegisterEmployee.Checked += (send, ev) => { RegisterVehicle.IsChecked = false; };
        }

        private void Next_Click(object sender, RoutedEventArgs e)
        {
            if (this.RegisterVehicle.IsChecked == true)
            {
                this.Close();
                VehicleWindow vehicleWindow = new VehicleWindow();
                vehicleWindow.ShowDialog();
            }

            else if (this.RegisterEmployee.IsChecked == true)
            {
                this.Close();
                EmployeeWindow employeeWindow = new EmployeeWindow();
                employeeWindow.ShowDialog();
            }

            else if (this.RegisterEmployee.IsChecked == false && this.RegisterVehicle.IsChecked == false)
            {
                ErrorWindow noChoiceWindow = new ErrorWindow();
                noChoiceWindow.ErrorText.Text = "No selection!";
                noChoiceWindow.ShowDialog();
            }
        }
    }
}
